#include <rclcpp/rclcpp.hpp>
#include <pluginlib/class_loader.hpp>
//加载基类头文件
#include "test_plugin/test_lib_base.hpp"

int main(int argc,char** argv){
    rclcpp::init(argc,argv);
    //创建插件加载器
    pluginlib::ClassLoader<test_plugin::TestLibBase> controller_loader("test_plugin","test_plugin::TestLibBase");
    //选择要加载的插件
    std::string controoler_name="test_plugin::TestLib";
    //加载插件--创建插件类对象
    auto controller=controller_loader.createSharedInstance(controoler_name);
    //使用插件类对象
    controller->start();
    // ......
    controller->stop();

    rclcpp::shutdown();
    return 0;
}